<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>

<!DOCTYPE html>
<html>
<head>
<base href="http://localhost:8080/MavenDemo01000/">
<meta charset="UTF-8">
<title>用户列表</title>
</head>
<body>
	<shiro:user>
		欢迎您,<h1 style="color: red"><shiro:principal property="account"></shiro:principal></h1>
		<a href="user/loginOut.do">退出登录</a>
	</shiro:user>
	<br>
	<shiro:hasPermission name="user:insert">
		<a href="user/add.do">添加</a>
	</shiro:hasPermission>
	<c:forEach var="user" items="${users }">
	
		<h1>
		${user }
		<c:forEach items="${user.roles }" var="role">
			${role.name }
		
		</c:forEach>
		
		<c:forEach items="${user.permissions }" var="permission">
			${permission.name }
		
		</c:forEach>
		<shiro:hasPermission name="user:delete">
			<a href="user/delete.do?id=${user.id}">删除</a>
		</shiro:hasPermission>
		<shiro:hasPermission name="user:update">
			<a href="user/edit.do?id=${user.id}">编辑</a>
		</shiro:hasPermission>
		</h1>
		
	
	</c:forEach>
<hr>

</body>
</html>